/*
 * Copyright (C) 2009, 2010, B3log Team
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.b3log.nide.util.parser.java.source;

/**
 * <a href="http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/java/nutsandbolts/_keywords.html">
 * Java Language Keywords</a>.
 *
 * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
 * @version 1.0.0.2, Jul 29, 2010
 */
public enum Keywords {

    /**
     * {@code abstract}.
     */
    ABSTRACT("abstract"),
    /**
     * {@code assert}.
     */
    ASSERT("assert"),
    /**
     * {@code boolean}.
     */
    BOOLEAN("boolean"),
    /**
     * {@code break}.
     */
    BREAK("break"),
    /**
     * {@code byte}.
     */
    BYTE("byte"),
    /**
     * {@code case}.
     */
    CASE("case"),
    /**
     * {@code catch}.
     */
    CATCH("catch"),
    /**
     * {@code char}.
     */
    CHAR("char"),
    /**
     * {@code class}.
     */
    CLASS("class"),
    /**
     * {@code const}.
     */
    CONST("const"),
    /**
     * {@code continue}.
     */
    CONTINUE("continue"),
    /**
     * {@code default}.
     */
    DEFAULT("default"),
    /**
     * {@code do.
     */
    DO("do"),
    /**
     * {@code double}.
     */
    DOUBLE("double"),
    /**
     * {@code else}.
     */
    ELSE("else"),
    /**
     * {@code enum}.
     */
    ENUM("enum"),
    /**
     * {@code extends}.
     */
    EXTENDS("extends"),
    /**
     * {@code final}.
     */
    FINAL("final"),
    /**
     * {@code finally}.
     */
    FINALLY("finally"),
    /**
     * {@code float}.
     */
    FLOAT("float"),
    /**
     * {@code for}.
     */
    FOR("for"),
    /**
     * {@code goto}.
     */
    GOTO("goto"),
    /**
     * {@code if}.
     */
    IF("if"),
    /**
     * {@code implements}.
     */
    IMPLEMENTS("implements"),
    /**
     * {@code import}.
     */
    IMPORT("import"),
    /**
     * {@code instanceof}.
     */
    INSTANCEOF("instanceof"),
    /**
     * {@code int}.
     */
    INT("int"),
    /**
     * {@code interface}.
     */
    INTERFACE("interface"),
    /**
     * {@code long}.
     */
    LONG("long"),
    /**
     * {@code native}.
     */
    NATIVE("native"),
    /**
     * {@code new}.
     */
    NEW("new"),
    /**
     * {@code package}.
     */
    PACKAGE("package"),
    /**
     * {@code private}.
     */
    PRIVATE("private"),
    /**
     * {@code protected}.
     */
    PROTECTED("protected"),
    /**
     * {@code public}.
     */
    PUBLIC("public"),
    /**
     * {@code return}.
     */
    RETURN("return"),
    /**
     * {@code short}.
     */
    SHORT("short"),
    /**
     * {@code static}.
     */
    STATIC("static"),
    /**
     * {@code strictfp}.
     */
    STRICTFP("strictfp"),
    /**
     * {@code super}.
     */
    SUPER("super"),
    /**
     * {@code switch}.
     */
    SWITCH("switch"),
    /**
     * {@code synchronized}.
     */
    SYNCHRONIZED("synchronized"),
    /**
     * {@code this}.
     */
    THIS("this"),
    /**
     * {@code throw}.
     */
    THROW("throw"),
    /**
     * {@code throws}.
     */
    THROWS("throws"),
    /**
     * {@code transient}.
     */
    TRANSIENT("transient"),
    /**
     * {@code try}.
     */
    TRY("try"),
    /**
     * {@code void}.
     */
    VOID("void"),
    /**
     * {@code volatile}.
     */
    VOLATILE("volatile"),
    /**
     * {@code while}.
     */
    WHILE("while");
    /**
     * Keyword itself.
     */
    private String string;

    /**
     * Constructs a keyword enumeration.
     *
     * @param string keyword itself
     */
    Keywords(final String string) {
        this.string = string;
    }

    /**
     * Gets the string of this keyword.
     *
     * @return string of this keyword
     */
    @Override
    public String toString() {
        return string;
    }

    /**
     * String length of this keyword.
     *
     * @return string length of this keyword
     */
    public int length() {
        return string.length();
    }
}
